package cn.suimg.neo4j.repository;

import cn.suimg.neo4j.relationship.PublishRelationship;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface PublishRelationshipRepository extends Neo4jRepository<PublishRelationship, Long> {

    @Query("match r = (singerGraph:歌手 {singerId:{0}}) -[rel:发布] -> (albumGraph:专辑{albumId:{1}}) return distinct r")
    PublishRelationship findBySingerIdAndAlbumId(Integer singerId,Integer albumId);
}
